package controller.permission;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Permission;
import service.PermissionService;
import service.impl.PermissionServiceImpl;


public class Edit extends HttpServlet {
	private static final long serialVersionUID = 1L;

	private PermissionService permissionService = new PermissionServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Integer id = Integer.parseInt(request.getParameter("id"));
		Permission permission = permissionService.queryById(id);
		request.setAttribute("permission", permission);
		
		String url = "/WEB-INF/jsp/permission/edit.jsp";
		request.getRequestDispatcher(url).forward(request, response);
	}

}
